package com.mifengkong.frwidget.banner.customerbanner;

import android.content.Context;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.mifengkong.frwidget.R;


/**
 * Created by jiangyongxing on 2017/9/3.
 * 描述：
 */

public class NumberIndicatorView extends LinearLayout {

    private TextView mContent;
    private int mCount;

    public NumberIndicatorView(Context context) {
        this(context, null);
    }

    public NumberIndicatorView(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public NumberIndicatorView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        inflate(context, R.layout.layout_number_indicator_view, this);
        initView();

    }

    private void initView() {
        mContent = (TextView) findViewById(R.id.lniv_content);
    }

    public void setImageCount(int count) {
        this.mCount = count;
    }

    public void setCurrentSelectPagePosition(int position) {
        mContent.setText(TextUtils.concat(String.valueOf(position), "/", String.valueOf(mCount)));
    }

}
